﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Drawing;
using System.IO;

namespace OSCProvider_CS
{
    class HelperMethods
    {
        public static string SerializeObjectToString(object o)
        {
            System.IO.StringWriter writer = new System.IO.StringWriter();

            Type t = o.GetType();
            XmlSerializer serializer = new XmlSerializer(t);
            serializer.Serialize(writer, o);

            return writer.ToString();
        }

        public static byte[] GetProviderJpeg()
        {
            Image img = TWOSC.Properties.Resources.Energy_Bliss;
            MemoryStream imgMemoryStream = new MemoryStream();
            img.Save(imgMemoryStream,System.Drawing.Imaging.ImageFormat.Jpeg);
            byte[] imgByteArray = imgMemoryStream.GetBuffer();
            return imgByteArray;
        }

    }
}
